<?php
	//列出操作权限
	require '../biz/backend.php';

	class action extends backend
	{
		var $get_privilege_id = 30;
		var $post_privilege_id = 30;

		function do_get()
		{
			$this->input['type_id'] = isset( $this->input['type_id'] ) ? $this->input['type_id'] : '';
			$this->input['name'] = isset( $this->input['name'] ) ? $this->input['name'] : '';

			$template = load( 'template', array( 'domain'=>'tpl.admin' ) );
			$privilege = load( 'biz.privilege' );
			$result = $privilege->all( $this->input );

			if ( $result['page'] > 1 )
			{
				$navigation = load( 'navigation' );
				$template->assign( 'bar', $navigation->compute( $result['total'], $result['size'] ) );
			}

			$template->assign( 'data', $result['data'] );
			$template->assign( 'current_url', config( 'current_url' ) );

			$privilege_type = load( 'biz.privilege_type' );
			$result = $privilege_type->all( array( 'page' => 1, 'size' => 9999 ) );
			$template->assign( 'privilege_type_array', $result['data'] );
			$template->appoint( $this->input );
			echo $template->parse( 'list_privilege.php' );
		}
	}

	$action = new action();
	$action->run();
?>